package com.itheima.demo03;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/13 15:55
 */
public class Fooder extends Thread {
    private ArrayBlockingQueue<String> AB;

    public Fooder(ArrayBlockingQueue<String> list) {
        this.AB = list;
    }

    @Override
    public void run() {
        while (true) {
            try {
                AB.put("包子");
                System.out.println("厨师放了一个包子!");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
